package shujia.day16.easyFactory;


public class AnimalFactory {

    public Animal createAnimal(String name){
        if("cat".equals(name)){
            return new Cat();
        }else if("tiger".equals(name)){
            return new Tiger();
        }else {
            System.out.println("没有该动物！");
            return null;
        }
    }
}
